3.168 \(\int \cos (e+f x) (a+b \sec ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=56 \[ \frac{a^2 \sin (e+f x)}{f}+\frac{b (4 a+b) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac{b^2 \tan (e+f x) \sec (e+f x)}{2 f} \]

[Out]

(b*(4*a + b)*ArcTanh[Sin[e + f*x]])/(2*f) + (a^2*Sin[e + f*x])/f + (b^2*Sec[e + f*x]*Tan[e + f*x])/(2*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0673528, antiderivative size = 56, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {4147, 390, 385, 206} \[ \frac{a^2 \sin (e+f x)}{f}+\frac{b (4 a+b) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac{b^2 \tan (e+f x) \sec (e+f x)}{2 f} \]

Antiderivative was successfully verified.

[In]

Int[Cos[e + f*x]*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

(b*(4*a + b)*ArcTanh[Sin[e + f*x]])/(2*f) + (a^2*Sin[e + f*x])/f + (b^2*Sec[e + f*x]*Tan[e + f*x])/(2*f)

Rule 4147

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = Fr
eeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 - ff^2*x^2)^
((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n
/2] && IntegerQ[p]

Rule 390

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Int[PolynomialDivide[(a + b*x^n)
^p, (c + d*x^n)^(-q), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && IGtQ[p, 0] && ILt
Q[q, 0] && GeQ[p, -q]

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> -Simp[((b*c - a*d)*x*(a + b*x^n)^(p +
 1))/(a*b*n*(p + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /
; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+b-a x^2\right )^2}{\left (1-x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (a^2+\frac{b (2 a+b)-2 a b x^2}{\left (1-x^2\right )^2}\right ) \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac{a^2 \sin (e+f x)}{f}+\frac{\operatorname{Subst}\left (\int \frac{b (2 a+b)-2 a b x^2}{\left (1-x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac{a^2 \sin (e+f x)}{f}+\frac{b^2 \sec (e+f x) \tan (e+f x)}{2 f}+\frac{(b (4 a+b)) \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sin (e+f x)\right )}{2 f}\\ &=\frac{b (4 a+b) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac{a^2 \sin (e+f x)}{f}+\frac{b^2 \sec (e+f x) \tan (e+f x)}{2 f}\\ \end{align*}

Mathematica [A]  time = 0.0333472, size = 80, normalized size = 1.43 \[ \frac{a^2 \sin (e) \cos (f x)}{f}+\frac{a^2 \cos (e) \sin (f x)}{f}+\frac{2 a b \tanh ^{-1}(\sin (e+f x))}{f}+\frac{b^2 \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac{b^2 \tan (e+f x) \sec (e+f x)}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[e + f*x]*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

(2*a*b*ArcTanh[Sin[e + f*x]])/f + (b^2*ArcTanh[Sin[e + f*x]])/(2*f) + (a^2*Cos[f*x]*Sin[e])/f + (a^2*Cos[e]*Si
n[f*x])/f + (b^2*Sec[e + f*x]*Tan[e + f*x])/(2*f)

________________________________________________________________________________________

Maple [A]  time = 0.055, size = 78, normalized size = 1.4 \begin{align*}{\frac{{a}^{2}\sin \left ( fx+e \right ) }{f}}+2\,{\frac{ab\ln \left ( \sec \left ( fx+e \right ) +\tan \left ( fx+e \right ) \right ) }{f}}+{\frac{{b}^{2}\sec \left ( fx+e \right ) \tan \left ( fx+e \right ) }{2\,f}}+{\frac{{b}^{2}\ln \left ( \sec \left ( fx+e \right ) +\tan \left ( fx+e \right ) \right ) }{2\,f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(f*x+e)*(a+b*sec(f*x+e)^2)^2,x)

[Out]

a^2*sin(f*x+e)/f+2/f*a*b*ln(sec(f*x+e)+tan(f*x+e))+1/2*b^2*sec(f*x+e)*tan(f*x+e)/f+1/2/f*b^2*ln(sec(f*x+e)+tan
(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 1.00985, size = 117, normalized size = 2.09 \begin{align*} -\frac{b^{2}{\left (\frac{2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 4 \, a b{\left (\log \left (\sin \left (f x + e\right ) + 1\right ) - \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 4 \, a^{2} \sin \left (f x + e\right )}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

-1/4*(b^2*(2*sin(f*x + e)/(sin(f*x + e)^2 - 1) - log(sin(f*x + e) + 1) + log(sin(f*x + e) - 1)) - 4*a*b*(log(s
in(f*x + e) + 1) - log(sin(f*x + e) - 1)) - 4*a^2*sin(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 0.515399, size = 239, normalized size = 4.27 \begin{align*} \frac{{\left (4 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} \log \left (\sin \left (f x + e\right ) + 1\right ) -{\left (4 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \,{\left (2 \, a^{2} \cos \left (f x + e\right )^{2} + b^{2}\right )} \sin \left (f x + e\right )}{4 \, f \cos \left (f x + e\right )^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/4*((4*a*b + b^2)*cos(f*x + e)^2*log(sin(f*x + e) + 1) - (4*a*b + b^2)*cos(f*x + e)^2*log(-sin(f*x + e) + 1)
+ 2*(2*a^2*cos(f*x + e)^2 + b^2)*sin(f*x + e))/(f*cos(f*x + e)^2)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)*(a+b*sec(f*x+e)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.19094, size = 113, normalized size = 2.02 \begin{align*} \frac{4 \, a^{2} \sin \left (f x + e\right ) +{\left (4 \, a b + b^{2}\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) -{\left (4 \, a b + b^{2}\right )} \log \left (-\sin \left (f x + e\right ) + 1\right ) - \frac{2 \, b^{2} \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1}}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/4*(4*a^2*sin(f*x + e) + (4*a*b + b^2)*log(sin(f*x + e) + 1) - (4*a*b + b^2)*log(-sin(f*x + e) + 1) - 2*b^2*s
in(f*x + e)/(sin(f*x + e)^2 - 1))/f